bin/pull-local: add --sign-verify
authorDenis Pynkin <denis.pynkin@collabora.com>
Sun, 17 Nov 2019 16:58:29 +0000 (19:58 +0300)
committerDenis Pynkin <denis.pynkin@collabora.com>
Wed, 25 Mar 2020 12:23:54 +0000 (15:23 +0300)
Add option for enabling verification while pulling from local.

Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
src/ostree/ot-builtin-pull-local.c

index 4b3224f3d3e3fdac9ec237ef46be556f7811547c..4dbd3bfd51b47d71efbab494dc68056af48f6615 100644 (file)
@@ -39,6 +39,7 @@ static gboolean opt_bareuseronly_files;
 static gboolean opt_require_static_deltas;
 static gboolean opt_gpg_verify;
 static gboolean opt_gpg_verify_summary;
+static gboolean opt_sign_verify;
 static int opt_depth = 0;
 
 /* ATTENTION:
@@ -55,6 +56,7 @@ static GOptionEntry options[] = {
   { "require-static-deltas", 0, 0, G_OPTION_ARG_NONE, &opt_require_static_deltas, "Require static deltas", NULL },
   { "gpg-verify", 0, 0, G_OPTION_ARG_NONE, &opt_gpg_verify, "GPG verify commits (must specify --remote)", NULL },
   { "gpg-verify-summary", 0, 0, G_OPTION_ARG_NONE, &opt_gpg_verify_summary, "GPG verify summary (must specify --remote)", NULL },
+  { "sign-verify", 0, 0, G_OPTION_ARG_NONE, &opt_sign_verify, "Verify commits signature (must specify --remote)", NULL },
   { "depth", 0, 0, G_OPTION_ARG_INT, &opt_depth, "Traverse DEPTH parents (-1=infinite) (default: 0)", "DEPTH" },
   { NULL }
 };
@@ -182,6 +184,10 @@ ostree_builtin_pull_local (int argc, char **argv, OstreeCommandInvocation *invoc
     g_variant_builder_add (&builder, "{s@v}", "depth",
                            g_variant_new_variant (g_variant_new_int32 (opt_depth)));
 
+    if (opt_sign_verify)
+      g_variant_builder_add (&builder, "{s@v}", "sign-verify",
+                             g_variant_new_variant (g_variant_new_boolean (TRUE)));
+
     if (console.is_tty)
       progress = ostree_async_progress_new_and_connect (ostree_repo_pull_default_console_progress_changed, &console);
     else